<template>
  <div class="c_policy_exchange">
    <!-- banner -->
    <div class="banner">
      <img src="../../assets/images/banner.png" alt />
    </div>
    <div class="box">
      <div class="location">
        <router-link to="/index">{{$t('common.nav.home')}}</router-link>
        <span class="sp">></span>
        <span>政策兑换</span>
        <span class="sp">></span>
        {{$t('news.detail')}}
      </div>
      <!--
      <div class="breadcrumb-nav">
        <el-breadcrumb separator=">">
          <el-breadcrumb-item>政策兑换</el-breadcrumb-item>
          <el-breadcrumb-item>内容详情</el-breadcrumb-item>
        </el-breadcrumb>
      </div>
      -->
      <div class="box-content white">
        <h2>
          {{con.title}}
          <el-tag v-if="con.applyStatusTxt && con.applyStatusTxt.length>0">{{con.applyStatusTxt}}</el-tag>
        </h2>
        <p class="p1">
          <span>政策兑现</span>
          <span>发布时间：{{con.cashInTime}}</span>
        </p>
        <p class="p2">
          <span>源政策：</span>
          <a :href="con.policyArticles.linkUrl" target="_blank" v-if="con.policyArticles && con.policyArticles.linkUrl">{{con.policyArticles.title}}</a>
        </p>
        <p class="p2-2">
          <span>总计申报人数：{{con.applyPolicyNum}}人</span>
          <span>兑现人数：{{con.cashInNum}}人</span>
        </p>
        <template v-if="list.length>0">
          <el-table
            ref="singleTable"
            :data="list"
            highlight-current-row
            @current-change="handleCurrentChange"
            style="width: 100%"
          >
            <el-table-column property="name" label="姓名" width="120"></el-table-column>
            <el-table-column property="sexTxt" label="性别" width="120"></el-table-column>
            <el-table-column property="applyName" label="归属企业"></el-table-column>
            <el-table-column property="auditOpinion" label="兑现说明"></el-table-column>
            <el-table-column property="cashInTxt" label="兑换结果" width="120"></el-table-column>
          </el-table>
          <div class="box-center">
            <el-pagination background  @size-change="handleSizeChange" @current-change="handleCurrentChange" :page-size="pagination.size" layout="prev, pager, next, jumper" :total="pagination.total"></el-pagination>
          </div>
        </template>
        
        
        <div class="hr"></div>
        <h2>政策申报内容</h2>
        <p class="p3">
          <span>申报主体：</span>{{con.subjectTypeTxt}}
        </p>

        <p class="p4">
          <span>申报时间：</span>
          {{con.beginTime}} 至 {{con.endTime}}
          <span>（注：超过申报时间将不允许提交申报材料）</span>
        </p>
        <p class="p5" v-html="con.briefContent"></p>
      </div>
    </div>
  </div>
</template>
<script>
import {ajax} from "@/utils/js.js";
import {getDeclarationCashInDetail,getStuffPage} from "@/services/api.js";
export default {
  components: {},
  data() {
    return {
      con:{},
      list:[],
      currentRow: null,
      banner: [],
      search:{
        declarationIssuedId: "",
      },
      pagination: {
        current: 1,
        size: 10,
        total: 0,
      },
    };
  },
  mounted() {
    let data = this.$route.query;
    this.search.declarationIssuedId=data.id;
    this.content();
  },
  computed: {},
  watch: {
    "$i18n.locale"() {
      this.content();
    },
  },
  methods: {
    content() {
      //政策兑换 
      ajax( this, getDeclarationCashInDetail, this.search, (res) => {
        this.con = res.data;
        this.getPagination();
      },err=>{

      });
    },
    getPagination(){
      let data = {
        declarationIssuedId:this.search.declarationIssuedId,
        pageNo: this.pagination.current,
	      pageSize: this.pagination.size,
      }

      ajax( this, getStuffPage, data, (res) => {
        this.list = res.data.records;
        this.pagination.total = res.data.total
      },err=>{

      });
    },
    //首页跳转
    indexLink(data) {
      if (data.outLink && data.outLink == 1) {
        window.open(data.linkUrl, "-blank");
      } else {
        window.location.href = data.linkUrl;
      }
    },
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`);
    },
    handleCurrentChange(val) {
      this.search.pageNo = val;
      this.getPagination();
    },
    setCurrent(row) {
      this.$refs.singleTable.setCurrentRow(row);
    }
  },
};
</script>
<style lang="scss">
.c_policy_exchange {
  .box-center {
    margin: 30px auto 60px auto;
    text-align: center;
    
  }
  .hr{
    width:100%;
    height:1px;
    background: rgba(239,239,239,1);
    opacity:1
  }
  .record {
    padding: 8px 0;
    font-size: 12px;
    font-family: Microsoft YaHei;
    font-weight: 400;
    line-height: 16px;
    color: rgba(153, 153, 153, 1);
    opacity: 1;
  }
  .banner {
    img {
      max-width: 100%;
      min-width: 1200px;
      display: block;
    }
    .el-carousel--button {
      width: 12px;
      height: 12px;
      background: rgba(255, 255, 255, 1);
      border-radius: 50%;
      opacity: 1;
    }
    .el-carousel--indicator.is-active button {
      background-color: #0f54bc;
    }
  }
  .noRecord {
    text-align: center;
    padding: 144px 0;
    border-top: 1px solid rgba(204, 204, 204, 1);
    p:first-child {
      text-align: center;
    }
    p:nth-child(2) {
      margin-top: 25px;
      font-size: 14px;
      font-family: Microsoft YaHei;
      font-weight: 400;
      color: rgba(153, 153, 153, 1);
      opacity: 1;
    }
    p:last-child {
      margin-top: 36px;
      font-size: 16px;
      font-family: Microsoft YaHei;
      font-weight: 400;
      color: rgba(119, 119, 119, 1);
      opacity: 1;
      a {
        margin-left: 14px;
        font-family: Microsoft YaHei;
        font-weight: 400;
        color: rgba(15, 84, 188, 1);
        opacity: 1;
        text-decoration: underline;
      }
    }
  }
  .white {
    background: #fff;
  }
  .box {
    box-sizing: border-box;
    width: 1200px;
    margin: 0 auto;
    .breadcrumb-nav {
      font-size: 13px;
      font-family: Microsoft YaHei;
      font-weight: 400;
      color: rgba(153, 153, 153, 1);
      opacity: 1;
      margin: 8px 0;
    }
    .box-content {
      margin-top: 6px;
      padding: 18px 120px;
      h2:first-child {
        margin-top: 34px;
        text-align: center;
        font-size: 22px;
        font-family: Microsoft YaHei;
        font-weight: bold;
        line-height: 29px;
        color: rgba(51, 51, 51, 1);
        opacity: 1;
        .el-tag {
          margin-left: 10px;
          font-size: 12px;
          font-family: Microsoft YaHei;
          font-weight: 400;
          line-height: 24px;
          color: rgba(15, 84, 188, 1);
          opacity: 1;
          background: rgba(15, 84, 188, 0.1);
        }
      }
      p.p1 {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: center;
        span {
          margin: 16px 15px;
        }
      }
      p.p2 {
        margin: 10px 0;
        font-size: 14px;
        font-family: Microsoft YaHei;
        font-weight: 400;
        line-height: 24px;
        color: rgba(51, 51, 51, 1);
        opacity: 1;
        a {
          font-size: 14px;
          font-family: Microsoft YaHei;
          font-weight: 400;
          line-height: 24px;
          color: rgba(15, 84, 188, 1);
          opacity: 1;
        }
      }
      p.p2-2 {
        margin: 10px 0;
        font-size: 14px;
        font-family: MicrosoftYaHei;
        line-height: 32px;
        color: rgba(51, 51, 51, 1);
        opacity: 1;
        span {
          margin-right: 42px;
        }
      }
      .el-table{
        border:1px solid rgba(239,239,239,1);
      }
      .el-table .el-table__header thead.has-gutter th.is-leaf{
        font-size:14px;
        font-family:Microsoft YaHei;
        font-weight:bold;
        line-height:19px;
        color:rgba(51,51,51,1);
        opacity:1;
        background: #f9f9f9;
      }
      .el-table tbody{
        color:rgba(102,102,102,1);
      }
      .el-table tbody .el-table__row .el-table_1_column_4{
        color:rgba(153,153,153,1);
      }
      p.p3 {
        margin: 5px 0;
        font-size: 14px;
        font-family: Microsoft YaHei;
        font-weight: 400;
        line-height: 24px;
        color: rgba(51, 51, 51, 1);
        opacity: 1;
      }
      p.p4 {
        margin: 5px 0;
        font-size: 14px;
        font-family: Microsoft YaHei;
        font-weight: 400;
        line-height: 24px;
        color: rgba(51, 51, 51, 1);
        opacity: 1;
        span:last-child {
          margin-left: 12px;
          color: rgba(153, 153, 153, 1);
        }
      }
      h3 {
        font-size: 14px;
        font-family: Microsoft YaHei;
        font-weight: 400;
        line-height: 24px;
        color: rgba(51, 51, 51, 1);
        opacity: 1;
        margin-bottom: 5px;
      }
      p.p5 {
        font-size: 14px;
        font-family: Microsoft YaHei;
        font-weight: 400;
        line-height: 24px;
        color: rgba(51, 51, 51, 1);
        opacity: 1;
        padding-bottom: 15px;
      }
      h2:nth-of-type(2) {
        font-size: 20px;
        font-family: Microsoft YaHei;
        font-weight: bold;
        line-height: 24px;
        color: rgba(51, 51, 51, 1);
        opacity: 1;
        border-left: 3px solid rgba(15, 84, 188, 1);
        padding-left: 5px;
        margin-top: 24px;
        margin-bottom: 19px;
      }
      .el-row {
        border-top: 1px solid rgba(239, 239, 239, 1);
        .el-col span {
          display: inline-block;
          padding: 26px 15px 31px 15px;
        }
      }
      dl {
        border: 1px solid rgba(239, 239, 239, 1);
        dt {
          font-size: 14px;
          font-family: Microsoft YaHei;
          font-weight: bold;
          line-height: 19px;
          color: rgba(51, 51, 51, 1);
          opacity: 1;
          padding: 14px 22px;
          background: #f6f6f6;
        }
        dd {
          display: flex;
          flex-direction: row;
          flex-wrap: nowrap;
          justify-content: space-between;
          font-size: 14px;
          font-family: Microsoft YaHei;
          font-weight: 400;
          line-height: 19px;
          padding: 13px 22px;
          color: rgba(51, 51, 51, 1);
          opacity: 1;
          border-bottom: 1px solid rgba(239, 239, 239, 1);
          a {
            font-family: Microsoft YaHei;
            font-weight: 400;
            line-height: 19px;
            color: rgba(15, 84, 188, 1);
            text-decoration: underline;
          }
        }
        dd:last-child {
          border: none;
        }
      }
      p.tips {
        font-size: 12px;
        font-family: Microsoft YaHei;
        font-weight: 400;
        line-height: 16px;
        padding: 4px 22px;
        color: rgba(153, 153, 153, 0.99);
      }
      .mt30 {
        margin-top: 30px;
      }
    }
  }
}
</style>